//-----------------------------------------------------------------------
// <copyright file="BannerCatService.cs" company="FetCo">
//     Copyright (c) FetCo. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using System.Collections;
using FetCo.Framework;
using ADESSA.Entities;
using ADESSA.Data;
    
namespace ADESSA.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class BannerCatService
    {
        #region BannerCat

        public static void CreateBannerCat(BannerCat bannerCat)
        {            
            try
            {
                BannerCatDAO bannerCatDAO = new BannerCatDAO();
                bannerCatDAO.CreateBannerCat(bannerCat);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessCreateBannerCatException, ex);
            }
        }        

        public static void UpdateBannerCat(BannerCat bannerCat)
        {            
            try
            {
                BannerCatDAO bannerCatDAO = new BannerCatDAO();
                bannerCatDAO.UpdateBannerCat(bannerCat);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessUpdateBannerCatException, ex);
            }
        }        

        public static void DeleteBannerCat(long locationId)
        {            
            try
            {
                BannerCatDAO bannerCatDAO = new BannerCatDAO();
                bannerCatDAO.DeleteBannerCat(locationId);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessDeleteBannerCatException, ex);
            }
        }
        
        public static BannerCat GetBannerCat(long locationId)
        {            
            try
            {
                BannerCatDAO bannerCatDAO = new BannerCatDAO();
                return bannerCatDAO.GetBannerCat(locationId);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetBannerCatException, ex);
            }
        }                

        public static BannerCatCollection GetBannerCatList(BannerCatColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                BannerCatDAO bannerCatDAO = new BannerCatDAO();
                return bannerCatDAO.GetBannerCatList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetBannerCatListException, ex);
            }
        }        

        public static BannerCatCollection GetBannerCatList(BannerCatColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                BannerCatDAO bannerCatDAO = new BannerCatDAO();
                return bannerCatDAO.GetBannerCatList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetBannerCatListException, ex);
            }
        }        

	    public static BannerCatCollection GetBannerCatListByParam(object orderBy, OrderDirection orderDirection,string where)
        {            
            try
            {
                BannerCatDAO bannerCatDAO = new BannerCatDAO();
                return bannerCatDAO.GetBannerCatListByParam(orderBy, orderDirection,where);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetBannerCatListException, ex);
            }
        }        

        public static BannerCatCollection GetBannerCatListByParam(object orderBy, OrderDirection orderDirection, int page, int pageSize,string Criteria, out int totalRecords)
        {            
            try
            {
                BannerCatDAO bannerCatDAO = new BannerCatDAO();
                return bannerCatDAO.GetBannerCatListByParam(orderBy, orderDirection, page, pageSize,Criteria, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetBannerCatListException, ex);
            }
        }        

        #endregion
    }
}